import request from '@/utils/request'

export function getDeliveryList(data:any){
    return request({
      url: '/sale/deliver/deliveryListByPage',
      method: 'post',
      data
    })
}

export function insertDelivery(data:any){
    return request({
      url: '/sale/deliver/insertDeliveryNote',
      method: 'post',
      data
    })
}

export function deleteDelivery(params:any){
    return request({
      url: '/sale/deliver/deleteDeliveryNote',
      method: 'delete',
      params,
    })
}

export function exportDelivery(data:any){
    return request({
      url: '/sale/deliver/exportDeliveryNote',
      method: 'post',
      data,
      responseType: 'blob',
    })
}

export function getStock(skuId:any){
    return request({
      url: `/sale/deliver/getStockBySkuId/${skuId}`,
      method: 'get',
    })
}

export function createApprovement(data:any){
    return request({
      url: '/inventory/approvement/createApprovement',
      method: 'post',
      data,
    })
}